Skip to content

Add linux-aarch64 kernel compatibility shim - #222

Open
birkskyum wants to merge 7 commits into
omacom:masterfrom
birkskyum:upstream/aarch64-limine
Open

Add linux-aarch64 kernel compatibility shim#222
birkskyum wants to merge 7 commits into
omacom:masterfrom
birkskyum:upstream/aarch64-limine

Conversation

@birkskyum

@birkskyum birkskyum commented Aug 27, 2026

Copy link
Copy Markdown

Summary

Adds linux-aarch64-pkgbase-shim so mkinitcpio and Limine can use Arch Linux ARM kernels installed as /boot/Image.

  • Supplies module-directory pkgbase metadata and vmlinuz.
  • Refreshes the image when a same-version reinstall changes its contents.
  • Preserves package-owned files and copies the image atomically with its original permissions.
  • Defers regeneration when the installer masks the normal hook, and reports rebuild failures.
  • Cleans up stale shim-only directories after kernel removal.

Why the shim remains needed

Limine can discover a kernel module directory without pkgbase, but mkinitcpio still needs a discoverable kernel image. The shim supplies /usr/lib/modules/<version>/vmlinuz until the ALARM kernel package provides it directly.

The existing aarch64 Limine/GraalVM/Gradle packaging is already on master and is not part of this PR.

Provenance and validation

Jimmy Van Veen authored the original shim in JimmayVV/omarchy-pkgs@snapdragon; original authorship is preserved.

ARM64 regression tests pass for initial installation, same-version refresh, permissions, rebuild suppression, masked hooks, ownership of either metadata file, failed copies, and removal with DKMS leftovers. The existing CI job now runs them. A native ARM64 makepkg --nodeps build of version 1-3, archive inspection, ShellCheck and whitespace checks also pass.

The September 6 pinned integration build built and published the shim and firmware extractor successfully.

The latest fixes were not deployed to the physical Yoga. Consumers are omacom/omarchy#8672 and omacom/omarchy-iso#129.

@birkskyum
birkskyum marked this pull request as ready for review August 27, 2026 21:50
@birkskyum

Copy link
Copy Markdown
Author

Native ARM64 validation: the cleaned package stack built successfully in the combined PR integration run. The run failed only in the later repository-database publishing step owned by #223, after all three requested packages had been produced. Build evidence: https://github.com/birkskyum/omarchy-pkgs/actions/runs/33118509188

@JimmayVV

JimmayVV commented Aug 27, 2026

Copy link
Copy Markdown

I think one piece of the shim this branch retires is still needed. Zesko !64 lets limine-mkinitcpio-install discover a kernel whose package ships no pkgbase. But the hook then runs mkinitcpio --kernel <version> without --kernelimage, and mkinitcpio only looks for the image at /lib/modules/<ver>/vmlinuz, /lib/modules/<ver>/vmlinux and /boot/vmlinuz-*. Arch Linux ARM installs /boot/Image, which matches none of those. So I'd expect the UKI build to fail with "Could not find kernel image" once nothing copies Image into the modules directory. That copy was the other half of what linux-aarch64-pkgbase-shim did, alongside writing pkgbase.

If your Yoga test ran with the shim still installed from the integration branch, that would explain it working. Two fixes I can see. Keep the shim here with its retirement note, or have this patch also point mkinitcpio at /boot/Image. Happy to be wrong if I've missed something in the branch.

@birkskyum

Copy link
Copy Markdown
Author

Good catch. Confirmed: MR 64 discovers the module directory but mkinitcpio still cannot find Arch Linux ARM's /boot/Image. I restored your three shim commits with authorship intact and added an ownership compatibility patch after MR 64, because the shim-written pkgbase is not package-owned. The PR is back in draft until the corrected exact stack passes a native ARM build.

@birkskyum
birkskyum marked this pull request as ready for review August 27, 2026 22:26
@birkskyum

Copy link
Copy Markdown
Author

Corrected native ARM validation passed, including linux-aarch64-pkgbase-shim 1-3, limine-mkinitcpio-hook 1.37.1-4, repository database creation, verification, and artifact upload: https://github.com/birkskyum/omarchy-pkgs/actions/runs/33122253609

JimmayVV and others added 5 commits September 6, 2026 00:48
Arch Linux ARM's kernel packages install the kernel as /boot/Image and ship
no usr/lib/modules/<ver>/{pkgbase,vmlinuz}, which is how mkinitcpio and
limine-entry-tool find kernels. One pacman hook, ordered 85- so it runs
before 90-mkinitcpio-install, writes both files into every package-owned
modules directory that lacks pkgbase; the usual hook then builds the UKI and
writes the Limine entry. It also covers kernels already present when the
shim itself is installed, cleans up the leftover directories of removed
kernels, and never touches a directory that has pkgbase, so it retires by
removal once archlinuxarm/PKGBUILDs#2215 (or its successor) lands.

Added to the aarch64 workflow's ISO package set.
…he 90 hook is masked

omarchy-iso's installer points 90-mkinitcpio-install.hook at /dev/null in
the target during the chroot phase and runs limine-update itself afterwards.
When the shim is installed in that phase it writes pkgbase and vmlinuz and
would otherwise start a UKI build that finalize_limine_boot throws away.
The aarch64 repo build only rebuilds packages whose version moved, so the
previous script fix never reached the repository.
@birkskyum
birkskyum force-pushed the upstream/aarch64-limine branch from adbec9d to df73713 Compare September 5, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants